package com.annotation.hw.hw2;

/**
 * @author bin
 * @date 2025 - 03 -28
 **/
public class Sum {

    public int getSum(@myAnnotation(10) int n) throws Exception {
        int value =new Util().value(this.getClass());
        int num = 0;
        for (int i = 1; i < value; i++) {
            num += i;
        }
        if(num > n){
            throw new Exception("num大于n");
        }else{
            return num;
        }
    }
}
